<template>
  <div>
    <panel title="数据统计表">
      <LineChart :xData="xData" :yData="seriesData"></LineChart>
    </panel>
  </div>
</template>
<script>
import LineChart from '@/components/line/LineChart.vue';
import { homeTotaldataReq } from '@/api/home.api'
import Panel from '@/panel/Panel.vue';
export default {
  components: { LineChart, Panel },
  data() {
    return {
      xData: [],
      seriesData: []
    };
  },
  created() {
    homeTotaldataReq().then(res => {
      this.xData = res.data.xData
      this.seriesData = [
        {
          name: '订单量',
          data: res.data.orderData
        },
        {
          name: '销售额',
          data: res.data.amountData
        }
      ]
    })
  },
}
</script>
<style lang="less" scoped>
div {
  min-height: 500px;
}
</style>
